package com.fulu.jvm;

import org.openjdk.jol.info.ClassLayout;

/**
 * 使用 JOL 工具查看内存结构
 */
public class JOLTest {

    public static void main(String[] args) {

        SimpleObject simpleObject = new SimpleObject();
        System.out.println(ClassLayout.parseInstance(simpleObject).toPrintable());

        B b = new B();
        System.out.println(ClassLayout.parseInstance(b).toPrintable());
    }


    static class A {
        short a;
    }

    static class B extends A {
        boolean b;
        long c;
    }

}
